//package com.yunxin.admin.system.api.core.popup;
//
//
//import com.yunxin.admin.system.infra.common.constant.SecurityConstants;
//import com.yunxin.admin.system.infra.framework.resubmit.Resubmit;
//import com.yunxin.admin.system.infra.framework.security.util.SecurityUtils;
//import com.yunxin.admin.system.infra.framework.syslog.AutoLog;
//import com.yunxin.common.result.PageResult;
//import com.yunxin.common.result.Result;
//import com.yunxin.core.application.command.popup.AddPopupCommand;
//import com.yunxin.core.application.command.popup.EditPopupCommand;
//import com.yunxin.core.application.command.popup.PopupPageCommand;
//import com.yunxin.core.application.dto.popup.PopupListDTO;
//import com.yunxin.core.application.dto.popup.PopupPageDTO;
//import com.yunxin.core.application.service.PopupApplicationAdminService;
//import com.yunxin.core.application.service.PopupQueryAdminService;
//import io.swagger.v3.oas.annotations.Operation;
//import io.swagger.v3.oas.annotations.security.SecurityRequirement;
//import io.swagger.v3.oas.annotations.tags.Tag;
//import lombok.RequiredArgsConstructor;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.security.access.prepost.PreAuthorize;
//import org.springframework.validation.annotation.Validated;
//import org.springframework.web.bind.annotation.PostMapping;
//import org.springframework.web.bind.annotation.RequestBody;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RestController;
//
//import java.util.List;
//
///**
// * @author zero°
// * @since 2023-12-11
// */
//@Tag(name = "82.推荐弹窗")
//@Slf4j
//@RestController
//@RequestMapping("/core/v1/popup")
//@RequiredArgsConstructor
//public class PopupController {
//
//    private final PopupQueryAdminService popupQueryAdminService;
//
//    private final PopupApplicationAdminService popupApplicationAdminService;
//
//    @Operation(summary = "分页查询推荐弹窗列表", security = {@SecurityRequirement(name = SecurityConstants.TOKEN_KEY)})
//    @PostMapping("/page")
//    public PageResult<PopupPageDTO> page(@Validated @RequestBody PopupPageCommand command) {
//        return popupQueryAdminService.page(command);
//    }
//
//    @Operation(summary = "新增推荐弹窗", security = {@SecurityRequirement(name = SecurityConstants.TOKEN_KEY)})
//    @PostMapping("/add")
//    @PreAuthorize("@ss.hasPerm('core:popup:add')")
//    @Resubmit
//    @AutoLog(value = "新增推荐弹窗")
//    public Result<Boolean> add(@Validated @RequestBody AddPopupCommand command) {
//        command.setCreator(SecurityUtils.X.getUser().getUsername());
//        return Result.success(popupApplicationAdminService.add(command));
//    }
//
//    @Operation(summary = "编辑推荐弹窗", security = {@SecurityRequirement(name = SecurityConstants.TOKEN_KEY)})
//    @PostMapping("/edit")
//    @PreAuthorize("@ss.hasPerm('core:popup:edit')")
//    @Resubmit
//    @AutoLog(value = "编辑推荐弹窗")
//    public Result<Boolean> edit(@Validated @RequestBody EditPopupCommand command) {
//        command.setEditor(SecurityUtils.X.getUser().getUsername());
//        return Result.success(popupApplicationAdminService.edit(command));
//    }
//
//    @Operation(summary = "查询推荐弹窗列表下拉框", security = {@SecurityRequirement(name = SecurityConstants.TOKEN_KEY)})
//    @PostMapping("/list")
//    public Result<List<PopupListDTO>> list() {
//        return Result.success(popupQueryAdminService.list());
//    }
//}
